export const AUTH = 'auth';
export const LOGIN = 'login';
export const REGISTER = 'register';
export const APP = 'app';
export const HOME = 'home';
export const GM_MANAGE = 'gm';
export const SYSTEM_PARAMS = 'system_params';
export const PLAYER_MANAGER = 'player_manager';
export const NOTICE_MANAGER = 'notice_manager';
export const MAIL_HISTORY = 'mail_history';
export const ACCOUNT_HISTORY = 'account_history';
export const SYSTEM_ACT_REPORT = 'system_act_report';
export const SYSTEM_ROI_REPORT = 'system_roi_report';

export const STORE = 'store';
export const GOODS_MGMS = 'goods';
export const PUTAWAY = 'putaway';
export const PUTAWAY_SILVER = 'putaway_silver';
export const PUTAWAY_GOLD = 'putaway_gold';
export const PUTAWAY_CARD = 'putaway_card';
// export const PUTAWAY_GEM = 'putaway_gem';
// export const PUTAWAY_GOLD = 'putaway_gold';
// export const PUTAWAY_COMMON = 'putaway_common';
export const PURCHASE_HISTORY = 'purchase_history';

export const GOODS_PUBLISH = 'goods_publish';
export const THEME_MANAGE = 'theme_manage';

export const pathNamesMap = (function () {
    const map = {};
    map[AUTH] = '权限';
    map[LOGIN] = '登录';
    map[REGISTER] = '注册';
    map[APP] = '应用程序';
    map[HOME] = '首页';
    map[GM_MANAGE] = 'GM管理';
    map[SYSTEM_PARAMS] = '系统参数';
    map[PLAYER_MANAGER] = '账号管理';
    map[MAIL_HISTORY] = '邮件查询';
    map[ACCOUNT_HISTORY] = '账单查询';
    map[NOTICE_MANAGER] = '系统公告';
    map[SYSTEM_ACT_REPORT] = '活跃度报表';
    map[SYSTEM_ROI_REPORT] = '回报率报表';
    //store
    map[STORE] = '商城';
    map[GOODS_MGMS] = '商品管理';
    map[PUTAWAY] = '上架管理';
    map[PUTAWAY_SILVER] = '银两';
    map[PUTAWAY_GOLD] = '元宝';
    map[PUTAWAY_CARD] = '卡牌';
    // map[PUTAWAY_GEM] = '宝石';
    // map[PUTAWAY_GOLD] = '金币';
    // map[PUTAWAY_COMMON] = '通用';
    map[PURCHASE_HISTORY] = '购买记录';

    map[GOODS_PUBLISH] = '商品发布';
    map[THEME_MANAGE] = '更换主题';

    return map;
})();

/**
 * 路径变换函数
 *
 * @param {*} key
 */
export const transformPath = function (path, separator) {
    // 分隔为数组
    const pathNames = path.split(separator);
    // 查表转换为新数组
    const pathTitles = pathNames.map(function (key) {
        const title = pathNamesMap[key];
        return title || key;
    });
    return pathTitles.join(separator);
};
